home *** CD-ROM | disk | FTP | other *** search
Wrap
<?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE background PUBLIC "-//Apple, Inc.//DTD background V 2.0//EN" "" > <background> <id>5296</id> <filler1>0</filler1> <bitmap>BMAP_5414.pbm</bitmap> <cantDelete> <true /> </cantDelete> <showPict> <true /> </showPict> <dontSearch> <false /> </dontSearch> <link rel="stylesheet" type="text/css" href="stylesheet_4895.css" /> <part> <id>3</id> <type>field</type> <visible> <true /> </visible> <dontWrap> <false /> </dontWrap> <dontSearch> <false /> </dontSearch> <sharedText> <true /> </sharedText> <fixedLineHeight> <true /> </fixedLineHeight> <autoTab> <false /> </autoTab> <lockText> <true /> </lockText> <rect> <left>22</left> <top>30</top> <right>262</right> <bottom>54</bottom> </rect> <style>transparent</style> <autoSelect> <false /> </autoSelect> <showLines> <false /> </showLines> <wideMargins> <false /> </wideMargins> <multipleLines> <false /> </multipleLines> <reservedFamily> 0 </reservedFamily> <titleWidth>0</titleWidth> <icon>0</icon> <textAlign>left</textAlign> <font>Helvetica</font> <textSize>18</textSize> <textStyle>plain</textStyle> <textHeight>24</textHeight> <name></name> <script>on returninfield end returninfield on closefield get char 1 to 28 of me set name of this card to it end closefield </script> </part> <part> <id>4</id> <type>button</type> <visible> <true /> </visible> <reserved5> 0 </reserved5> <reserved4> 0 </reserved4> <reserved3> 0 </reserved3> <reserved2> 0 </reserved2> <reserved1> 0 </reserved1> <enabled> <true /> </enabled> <rect> <left>467</left> <top>27</top> <right>492</right> <bottom>54</bottom> </rect> <style>transparent</style> <showName> <false /> </showName> <highlight> <false /> </highlight> <autoHighlight> <true /> </autoHighlight> <sharedHighlight> <true /> </sharedHighlight> <family>0</family> <titleWidth>0</titleWidth> <icon>18223</icon> <textAlign>center</textAlign> <font>Geneva</font> <textSize>12</textSize> <textStyle>plain</textStyle> <name></name> <script>on mouseUp lock screen set cursor to 4 put "Menu Maker Overview" into theFld show bg fld theFld set scroll of bg fld theFld to 0 unlock screen with visual barn door open end mouseUp</script> </part> <part> <id>7</id> <type>field</type> <visible> <true /> </visible> <dontWrap> <true /> </dontWrap> <dontSearch> <false /> </dontSearch> <sharedText> <false /> </sharedText> <fixedLineHeight> <true /> </fixedLineHeight> <autoTab> <true /> </autoTab> <lockText> <false /> </lockText> <rect> <left>114</left> <top>77</top> <right>246</right> <bottom>93</bottom> </rect> <style>transparent</style> <autoSelect> <false /> </autoSelect> <showLines> <true /> </showLines> <wideMargins> <false /> </wideMargins> <multipleLines> <false /> </multipleLines> <reservedFamily> 0 </reservedFamily> <titleWidth>0</titleWidth> <icon>0</icon> <textAlign>left</textAlign> <font>Geneva</font> <textSize>9</textSize> <textStyle>bold</textStyle> <textHeight>12</textHeight> <name>MenuTitle</name> <script>on closeField renameFld end closeField on renameFld global HCTestMenuHC if me is HCTestMenuHC then exit renameFld customMenuDispose customMenuBuild end renameFld </script> </part> <part> <id>14</id> <type>button</type> <visible> <true /> </visible> <reserved5> 0 </reserved5> <reserved4> 0 </reserved4> <reserved3> 0 </reserved3> <reserved2> 0 </reserved2> <reserved1> 0 </reserved1> <enabled> <true /> </enabled> <rect> <left>34</left> <top>75</top> <right>112</right> <bottom>90</bottom> </rect> <style>rectangle</style> <showName> <true /> </showName> <highlight> <false /> </highlight> <autoHighlight> <true /> </autoHighlight> <sharedHighlight> <false /> </sharedHighlight> <family>0</family> <titleWidth>0</titleWidth> <icon>0</icon> <textAlign>center</textAlign> <font>Geneva</font> <textSize>9</textSize> <textStyle>plain</textStyle> <name>Create Menu</name> <script>on mouseUp answer "Replace the existing menu or create a new menu on a new card?"¬ with "Replace" or "New Card" or "Cancel" -- ∆ if it is "Cancel" then exit mouseUp -- ∆ else if it is "New Card" then send "doMenu" && quote & "New Card" & quote to HyperCard -- ∆ else ask "Enter a new name for the menu:" with bg fld "MenuTitle" -- ∆ if the result is empty then put it into bg fld "MenuTitle" customMenuDispose customMenuBuild end if end if end mouseUp </script> </part> <part> <id>15</id> <type>field</type> <visible> <true /> </visible> <dontWrap> <true /> </dontWrap> <dontSearch> <false /> </dontSearch> <sharedText> <false /> </sharedText> <fixedLineHeight> <true /> </fixedLineHeight> <autoTab> <true /> </autoTab> <lockText> <true /> </lockText> <rect> <left>34</left> <top>141</top> <right>246</right> <bottom>245</bottom> </rect> <style>scrolling</style> <autoSelect> <false /> </autoSelect> <showLines> <false /> </showLines> <wideMargins> <true /> </wideMargins> <multipleLines> <false /> </multipleLines> <reservedFamily> 0 </reservedFamily> <titleWidth>0</titleWidth> <icon>0</icon> <textAlign>left</textAlign> <font>Geneva</font> <textSize>12</textSize> <textStyle>plain</textStyle> <textHeight>14</textHeight> <name>MenuItems</name> <script>on mouseDown if the value of the clickLine is empty then beep answer "Please click on a menu item." else selectMenuItem word 2 of the clickLine end mouseDown on lineClear repeat with count = 1 to number of lines in bg fld "MenuItems" set textStyle of line count of bg fld "MenuItems" to plain end repeat end lineClear </script> </part> <part> <id>16</id> <type>button</type> <visible> <true /> </visible> <reserved5> 0 </reserved5> <reserved4> 0 </reserved4> <reserved3> 0 </reserved3> <reserved2> 0 </reserved2> <reserved1> 0 </reserved1> <enabled> <true /> </enabled> <rect> <left>34</left> <top>120</top> <right>131</right> <bottom>135</bottom> </rect> <style>rectangle</style> <showName> <true /> </showName> <highlight> <false /> </highlight> <autoHighlight> <true /> </autoHighlight> <sharedHighlight> <false /> </sharedHighlight> <family>0</family> <titleWidth>0</titleWidth> <icon>0</icon> <textAlign>center</textAlign> <font>Geneva</font> <textSize>9</textSize> <textStyle>plain</textStyle> <name>Add a Menu Item</name> <script>on mouseUp global LastLine,HCTestMenuHC if HCTestMenuHC = empty then send "mouseUp" to bg btn "Create Menu" ask "Enter the name of the menu item:" with empty -- ∆ if it is empty or the result is "Cancel" then exit mouseUp -- ∆ put it into theNewMenuItem if number of lines in bg field "MenuItems" is zero then put theNewMenuItem & return into bg field "MenuItems" put 1 into LastLine put 1 into theItem put ",false,false," & return into bg field "MenuItemStuff" else answer "Should the new menu item replace or be added before or after the currently" && ¬ "selected menu item? Press ⌘-period to cancel." with "Replace" or "Before" or "After" -- ∆ if it is "After" then -- ∆ put theNewMenuItem & return before line (LastLine + 1) of bg field "MenuItems" put ",false,false," & return before line (LastLine + 1) of bg field "MenuItemStuff" put (LastLine + 1) into theItem else if it is "Before" then -- ∆ if LastLine is 1 then lock screen put theNewMenuItem & return before line 1 of bg field "MenuItems" set textStyle of char 1 to ((number of chars in line 1 of bg field "MenuItems") + 1) of bg field "MenuItems" to plain put ",false,false," & return before line 1 of bg field "MenuItemStuff" unlock screen put 1 into theItem else put return & theNewMenuItem after line (LastLine - 1) of bg field "MenuItems" put return & ",false,false," after line (LastLine - 1) of bg field "MenuItemStuff" put LastLine into theItem end if else if it is "Replace" then -- ∆ put theNewMenuItem into line LastLine of bg field "MenuItems" put ",false,false," into line LastLine of bg field "MenuItemStuff" put LastLine into theItem end if end if put lineSelected() into LastLine selectMenuItem theItem if there is no menu HCTestMenuHC then create menu HCTestMenuHC put bg field "MenuItems" into menu HCTestMenuHC customMenuUpdateItems end mouseUp</script> </part> <part> <id>28</id> <type>button</type> <visible> <true /> </visible> <reserved5> 0 </reserved5> <reserved4> 0 </reserved4> <reserved3> 0 </reserved3> <reserved2> 0 </reserved2> <reserved1> 0 </reserved1> <enabled> <true /> </enabled> <rect> <left>31</left> <top>264</top> <right>130</right> <bottom>278</bottom> </rect> <style>checkbox</style> <showName> <true /> </showName> <highlight> <false /> </highlight> <autoHighlight> <false /> </autoHighlight> <sharedHighlight> <false /> </sharedHighlight> <family>0</family> <titleWidth>0</titleWidth> <icon>0</icon> <textAlign>center</textAlign> <font>Geneva</font> <textSize>9</textSize> <textStyle>plain</textStyle> <name>Check Mark</name> <script>on mouseUp global HCTestMenuHC,LastLine if ((HCTestMenuHC ≠ empty) and (LastLine > 0)) then set hilite of me to not hilite of me if there is no menu HCTestMenuHC then customMenuBuild if hilite of me then set checkMark of menuItem lineSelected() of menu HCTestMenuHC to true else set checkMark of menuItem lineSelected() of menu HCTestMenuHC to false writeState end if end mouseUp</script> </part> <part> <id>29</id> <type>button</type> <visible> <true /> </visible> <reserved5> 0 </reserved5> <reserved4> 0 </reserved4> <reserved3> 0 </reserved3> <reserved2> 0 </reserved2> <reserved1> 0 </reserved1> <enabled> <true /> </enabled> <rect> <left>31</left> <top>249</top> <right>130</right> <bottom>263</bottom> </rect> <style>checkbox</style> <showName> <true /> </showName> <highlight> <false /> </highlight> <autoHighlight> <false /> </autoHighlight> <sharedHighlight> <false /> </sharedHighlight> <family>0</family> <titleWidth>0</titleWidth> <icon>0</icon> <textAlign>center</textAlign> <font>Geneva</font> <textSize>9</textSize> <textStyle>plain</textStyle> <name>Disable</name> <script>on mouseUp global HCTestMenuHC,LastLine if ((HCTestMenuHC ≠ empty) and (LastLine > 0)) then set hilite of me to not hilite of me if there is no menu HCTestMenuHC then customMenuBuild if hilite of me then disable menuItem lineSelected() of menu HCTestMenuHC else enable menuItem lineSelected() of menu HCTestMenuHC writeState end if end mouseUp</script> </part> <part> <id>34</id> <type>field</type> <visible> <true /> </visible> <dontWrap> <true /> </dontWrap> <dontSearch> <false /> </dontSearch> <sharedText> <false /> </sharedText> <fixedLineHeight> <true /> </fixedLineHeight> <autoTab> <false /> </autoTab> <lockText> <true /> </lockText> <rect> <left>34</left> <top>299</top> <right>246</right> <bottom>317</bottom> </rect> <style>rectangle</style> <autoSelect> <false /> </autoSelect> <showLines> <false /> </showLines> <wideMargins> <false /> </wideMargins> <multipleLines> <false /> </multipleLines> <reservedFamily> 0 </reservedFamily> <titleWidth>0</titleWidth> <icon>0</icon> <textAlign>left</textAlign> <font>Geneva</font> <textSize>12</textSize> <textStyle>plain</textStyle> <textHeight>16</textHeight> <name>MenuMessage</name> <script>on mouseUp addMenuMsg end mouseUp</script> </part> <part> <id>67</id> <type>field</type> <visible> <true /> </visible> <dontWrap> <true /> </dontWrap> <dontSearch> <false /> </dontSearch> <sharedText> <false /> </sharedText> <fixedLineHeight> <true /> </fixedLineHeight> <autoTab> <false /> </autoTab> <lockText> <false /> </lockText> <rect> <left>225</left> <top>262</top> <right>246</right> <bottom>280</bottom> </rect> <style>rectangle</style> <autoSelect> <false /> </autoSelect> <showLines> <false /> </showLines> <wideMargins> <false /> </wideMargins> <multipleLines> <false /> </multipleLines> <reservedFamily> 0 </reservedFamily> <titleWidth>0</titleWidth> <icon>0</icon> <textAlign>center</textAlign> <font>Chicago</font> <textSize>12</textSize> <textStyle>plain</textStyle> <textHeight>16</textHeight> <name>CmdKey</name> <script>on closeField updateField end closeField on exitField updateField end exitField on returnInField updateField end returnInField on enterInField updateField end enterInField on updateField global HCTestMenuHC if HCTestMenuHC ≠ empty then put char 1 of me into me if there is no menu HCTestMenuHC then customMenuBuild set commandChar of menuItem lineSelected() of menu HCTestMenuHC to me writeState end if end updateField</script> </part> <part> <id>44</id> <type>field</type> <visible> <true /> </visible> <dontWrap> <true /> </dontWrap> <dontSearch> <false /> </dontSearch> <sharedText> <false /> </sharedText> <fixedLineHeight> <true /> </fixedLineHeight> <autoTab> <false /> </autoTab> <lockText> <false /> </lockText> <rect> <left>274</left> <top>119</top> <right>481</right> <bottom>317</bottom> </rect> <style>scrolling</style> <autoSelect> <false /> </autoSelect> <showLines> <false /> </showLines> <wideMargins> <true /> </wideMargins> <multipleLines> <false /> </multipleLines> <reservedFamily> 0 </reservedFamily> <titleWidth>0</titleWidth> <icon>0</icon> <textAlign>left</textAlign> <font>Monaco</font> <textSize>9</textSize> <textStyle>plain</textStyle> <textHeight>12</textHeight> <name>Handlers</name> <script> on closeField end closeField</script> </part> <part> <id>47</id> <type>button</type> <visible> <true /> </visible> <reserved5> 0 </reserved5> <reserved4> 0 </reserved4> <reserved3> 0 </reserved3> <reserved2> 0 </reserved2> <reserved1> 0 </reserved1> <enabled> <true /> </enabled> <rect> <left>136</left> <top>120</top> <right>246</right> <bottom>135</bottom> </rect> <style>rectangle</style> <showName> <true /> </showName> <highlight> <false /> </highlight> <autoHighlight> <true /> </autoHighlight> <sharedHighlight> <false /> </sharedHighlight> <family>0</family> <titleWidth>0</titleWidth> <icon>0</icon> <textAlign>center</textAlign> <font>Geneva</font> <textSize>9</textSize> <textStyle>plain</textStyle> <name>Delete a Menu Item</name> <script>on mouseUp global HCTestMenuHC,LastLine if LastLine is empty or LastLine is zero then answer "Please select a menu item to delete first." -- ∆ exit mouseUp end if if the textStyle of line LastLine of bg field "MenuItems" is "bold,underline,condense" then if the optionKey is not down then answer "Delete menu item “" & line LastLine of bg field "MenuItems" & "”?" with "Cancel" or "OK" -- ∆ if it ≠ "OK" then exit mouseUp -- ∆ end if if there is no menu HCTestMenuHC then customMenuBuild delete line LastLine of bg field "MenuItems" delete line LastLine of bg field "MenuItemStuff" delete menuItem LastLine of menu HCTestMenuHC if ((LastLine - 1) = number of lines in bg field "MenuItems") then selectMenuItem (Lastline - 1) else if (number of lines in bg field "MenuItems") > 1 then selectMenuItem LastLine else set textStyle of line 1 of bg field "MenuItems" to bold,underline,condense end if put lineSelected() into LastLine if LastLine = 0 then set hilite of bg btn id 29 to false set hilite of bg btn id 28 to false put empty into bg field "CmdKey" put empty into bg field "MenuMessage" if the number of menuItems of menu HCTestMenuHC > 0 then delete last menuItem of menu HCTestMenuHC end if else customMenuUpdateItems end if end mouseUp</script> </part> <part> <id>48</id> <type>field</type> <visible> <false /> </visible> <dontWrap> <false /> </dontWrap> <dontSearch> <false /> </dontSearch> <sharedText> <false /> </sharedText> <fixedLineHeight> <false /> </fixedLineHeight> <autoTab> <false /> </autoTab> <lockText> <false /> </lockText> <rect> <left>4</left> <top>0</top> <right>490</right> <bottom>12</bottom> </rect> <style>rectangle</style> <autoSelect> <false /> </autoSelect> <showLines> <false /> </showLines> <wideMargins> <false /> </wideMargins> <multipleLines> <false /> </multipleLines> <reservedFamily> 0 </reservedFamily> <titleWidth>0</titleWidth> <icon>0</icon> <textAlign>left</textAlign> <font>Geneva</font> <textSize>9</textSize> <textStyle>plain</textStyle> <textHeight>12</textHeight> <name>MenuItemStuff</name> <script>on mouseUp hide me end mouseUp</script> </part> <part> <id>56</id> <type>field</type> <visible> <true /> </visible> <dontWrap> <false /> </dontWrap> <dontSearch> <true /> </dontSearch> <sharedText> <true /> </sharedText> <fixedLineHeight> <false /> </fixedLineHeight> <autoTab> <false /> </autoTab> <lockText> <true /> </lockText> <rect> <left>136</left> <top>264</top> <right>227</right> <bottom>279</bottom> </rect> <style>transparent</style> <autoSelect> <false /> </autoSelect> <showLines> <false /> </showLines> <wideMargins> <false /> </wideMargins> <multipleLines> <false /> </multipleLines> <reservedFamily> 0 </reservedFamily> <titleWidth>0</titleWidth> <icon>0</icon> <textAlign>right</textAlign> <font>Geneva</font> <textSize>9</textSize> <textStyle>plain</textStyle> <textHeight>12</textHeight> <name></name> <script>on mouseUp select text of bg field "CmdKey" end mouseUp</script> </part> <part> <id>58</id> <type>field</type> <visible> <true /> </visible> <dontWrap> <false /> </dontWrap> <dontSearch> <true /> </dontSearch> <sharedText> <true /> </sharedText> <fixedLineHeight> <true /> </fixedLineHeight> <autoTab> <false /> </autoTab> <lockText> <true /> </lockText> <rect> <left>30</left> <top>285</top> <right>228</right> <bottom>300</bottom> </rect> <style>transparent</style> <autoSelect> <false /> </autoSelect> <showLines> <false /> </showLines> <wideMargins> <false /> </wideMargins> <multipleLines> <false /> </multipleLines> <reservedFamily> 0 </reservedFamily> <titleWidth>0</titleWidth> <icon>0</icon> <textAlign>left</textAlign> <font>Geneva</font> <textSize>9</textSize> <textStyle>plain</textStyle> <textHeight>12</textHeight> <name></name> <script>on mouseUp addMenuMsg end mouseUp</script> </part> <part> <id>59</id> <type>field</type> <visible> <true /> </visible> <dontWrap> <false /> </dontWrap> <dontSearch> <false /> </dontSearch> <sharedText> <true /> </sharedText> <fixedLineHeight> <true /> </fixedLineHeight> <autoTab> <false /> </autoTab> <lockText> <true /> </lockText> <rect> <left>262</left> <top>62</top> <right>495</right> <bottom>90</bottom> </rect> <style>transparent</style> <autoSelect> <false /> </autoSelect> <showLines> <false /> </showLines> <wideMargins> <false /> </wideMargins> <multipleLines> <false /> </multipleLines> <reservedFamily> 0 </reservedFamily> <titleWidth>0</titleWidth> <icon>0</icon> <textAlign>left</textAlign> <font>Geneva</font> <textSize>9</textSize> <textStyle>plain</textStyle> <textHeight>12</textHeight> <name></name> <script></script> </part> <part> <id>60</id> <type>button</type> <visible> <true /> </visible> <reserved5> 0 </reserved5> <reserved4> 0 </reserved4> <reserved3> 0 </reserved3> <reserved2> 0 </reserved2> <reserved1> 0 </reserved1> <enabled> <true /> </enabled> <rect> <left>315</left> <top>95</top> <right>429</right> <bottom>110</bottom> </rect> <style>rectangle</style> <showName> <true /> </showName> <highlight> <false /> </highlight> <autoHighlight> <true /> </autoHighlight> <sharedHighlight> <false /> </sharedHighlight> <family>0</family> <titleWidth>0</titleWidth> <icon>0</icon> <textAlign>center</textAlign> <font>Geneva</font> <textSize>9</textSize> <textStyle>plain</textStyle> <name>Create Menu Script</name> <script>on mouseUp global gMenuConflict if (bg fld "MenuTitle" is empty) then answer "You must first enter a name." -- ∆ else if (bg fld "MenuItems" is empty) then answer "Please add some menu items to your menu." -- ∆ else ask "Please enter a handler name for the main menu handler:" with "createMenu" -- ∆ if it is empty or the result is "Cancel" then exit mouseUp -- ∆ if gMenuConflict is true then answer "This menu conflicted with one of the " & ¬ "menus in the menu bar. You may have to modify this script before it will work." ¬ with "OK" -- ∆ set cursor to watch put it into mainName put bg field "MenuTitle" into menuName put customMenuScript(mainName,menuName) into bg field "Handlers" set scroll of bg field "Handlers" to zero select text of bg field "Handlers" end if end mouseUp function customMenuScript mainName,menuName put empty into theHandlers put mainMenuHandler(mainName,menuName) & return & return after theHandlers put deleteMenuHandler(mainName,menuName) & return & return after theHandlers put makeItemsHandler(mainName) & return & return after theHandlers put makeMsgsHandler(mainName) & return & return after theHandlers put makeSystemHandlers(mainName) & return & return after theHandlers return theHandlers end customMenuScript function mainMenuHandler mainName,menuName put "-- Please place these handlers" & return & ¬ -- ∆ "-- into your stack script." & return & return & "on" && mainName & return & ¬ "if wrongStack() then pass" && mainName & return & ¬ "if there is a menu" && quote & menuName & quote && "then exit" && ¬ mainName & return & "create menu" && quote & menuName & quote & return & ¬ "put" && word 2 of line 1 of makeItemsHandler(mainName) & "()" && ¬ "into menu" && quote & menuName & quote && "with menuMsg" && ¬ word 2 of line 1 of makeMsgsHandler(mainName) & "()" & return into handlerTxt put bg field "MenuItemStuff" into menuData put number of lines in menuData into numDataLines repeat with count = 1 to numDataLines -- do commandChars get item 4 of line count of menuData if it ≠ empty then put "set commandChar of menuItem" && count && "of menu" && quote & menuName & quote && ¬ "to" && quote & it & quote & return after handlerTxt end repeat repeat with count = 1 to numDataLines -- do checkMarks if item 3 of line count of menuData then put "set checkMark of menuItem" && count && "of menu" && quote & menuName & quote && ¬ "to true" & return after handlerTxt end repeat repeat with count = 1 to numDataLines -- do disabled if item 2 of line count of menuData then put "disable menuItem" && count && "of menu" && quote & menuName & quote ¬ & return after handlerTxt end repeat put "end" && mainName after handlerTxt return handlerTxt pass mainMenuHandler end mainMenuHandler function deleteMenuHandler mainName,menuName return "on un" & mainName & return & ¬ "if wrongStack() then pass un" & mainName & return & ¬ "if there is not a menu" && quote & ¬ menuName & quote && "then exit" && ¬ "un" & mainName & return & ¬ "else delete menu" && quote & ¬ menuName & quote & return & ¬ "end un" & mainName pass deleteMenuHandler end deleteMenuHandler function makeItemsHandler mainName put mainName & "Items" into myName put number of lines in bg field "MenuItems" into numLines put "function" && myName & return & ¬ "if wrongStack() then pass" && myName & return & "return" into handlerTxt repeat with i = 1 to numLines put space & quote & line i of bg field "MenuItems" & quote after handlerTxt if i ≠ numLines then put " & return & ¬" & return after handlerTxt end repeat put return & "end" && myName after handlerTxt return handlerTxt pass makeItemsHandler end makeItemsHandler function makeMsgsHandler mainName put mainName & "Msgs" into myName put empty into theMsgs put the number of lines in bg field "MenuItemStuff" into numLines put "function" && myName & return & ¬ "if wrongStack() then pass" && myName & return & "return" into handlerTxt repeat with count = 1 to numLines get item 1 of line count of bg field "MenuItemStuff" if quote is in it then put empty into tempTxt put false into isQuote repeat with count = 1 to number of chars in it if char count of it ≠ quote then put char count of it after tempTxt else if isQuote then put quote & tempTxt & quote && "& quote & " after handlerTxt put false into isQuote else put quote & tempTxt & quote && "& quote & " after handlerTxt put true into isQuote end if put empty into tempTxt end if end repeat put "return & " after handlerTxt else put quote & it & quote && "& return & " after handlerTxt if count ≠ numLines then put "¬" & return after handlerTxt end repeat repeat until last word of handlerTxt is not in "&,¬,return" delete last word of handlerTxt end repeat if last char of handlerTxt is quote then put return after handlerTxt put "end" && myName after handlerTxt return handlerTxt pass makeMsgsHandler end makeMsgsHandler function makeSystemHandlers mainName return "function wrongStack" & return & ¬ "get the value of word 2 of the long name of me" & return & ¬ "return (it is not line 1 of the stacks)" & return & ¬ "end wrongStack" & return & return & ¬ "on openStack" & return & ¬ "if wrongStack() then pass openStack" & return & ¬ mainName & return & ¬ "pass openStack" & return & ¬ "end openStack" & return & return & ¬ "on closeStack" & return & ¬ "if wrongStack() then pass closeStack" & return & ¬ "un" & mainName & return & ¬ "pass closeStack" & return & ¬ "end closeStack" & return & return & ¬ "on resume" & return & ¬ "if wrongStack() then pass resume" & return & ¬ mainName & return & ¬ "pass resume" & return & ¬ "end resume" & return & return & ¬ "on suspend" & return & ¬ "if wrongStack() then pass suspend" & return & ¬ "un" & mainName & return & ¬ "pass suspend" & return & ¬ "end suspend" & return & return & ¬ "on resumeStack" & return & ¬ "if wrongStack() then pass resumeStack" & return & ¬ mainName & return & ¬ "pass resumeStack" & return & ¬ "end resumeStack" & return & return & ¬ "on suspendStack" & return & ¬ "if wrongStack() then pass suspendStack" & return & ¬ "un" & mainName & return & ¬ "pass suspendStack" & return & ¬ "end suspendStack" pass makeSystemHandlers end makeSystemHandlers </script> </part> <part> <id>61</id> <type>field</type> <visible> <true /> </visible> <dontWrap> <false /> </dontWrap> <dontSearch> <true /> </dontSearch> <sharedText> <true /> </sharedText> <fixedLineHeight> <true /> </fixedLineHeight> <autoTab> <false /> </autoTab> <lockText> <true /> </lockText> <rect> <left>18</left> <top>62</top> <right>245</right> <bottom>76</bottom> </rect> <style>transparent</style> <autoSelect> <false /> </autoSelect> <showLines> <false /> </showLines> <wideMargins> <false /> </wideMargins> <multipleLines> <false /> </multipleLines> <reservedFamily> 0 </reservedFamily> <titleWidth>0</titleWidth> <icon>0</icon> <textAlign>left</textAlign> <font>Geneva</font> <textSize>9</textSize> <textStyle>plain</textStyle> <textHeight>12</textHeight> <name></name> <script></script> </part> <part> <id>62</id> <type>field</type> <visible> <true /> </visible> <dontWrap> <false /> </dontWrap> <dontSearch> <true /> </dontSearch> <sharedText> <true /> </sharedText> <fixedLineHeight> <true /> </fixedLineHeight> <autoTab> <false /> </autoTab> <lockText> <true /> </lockText> <rect> <left>20</left> <top>103</top> <right>257</right> <bottom>117</bottom> </rect> <style>transparent</style> <autoSelect> <false /> </autoSelect> <showLines> <false /> </showLines> <wideMargins> <false /> </wideMargins> <multipleLines> <false /> </multipleLines> <reservedFamily> 0 </reservedFamily> <titleWidth>0</titleWidth> <icon>0</icon> <textAlign>left</textAlign> <font>Geneva</font> <textSize>9</textSize> <textStyle>plain</textStyle> <textHeight>12</textHeight> <name></name> <script></script> </part> <part> <id>66</id> <type>field</type> <visible> <false /> </visible> <dontWrap> <false /> </dontWrap> <dontSearch> <true /> </dontSearch> <sharedText> <true /> </sharedText> <fixedLineHeight> <false /> </fixedLineHeight> <autoTab> <false /> </autoTab> <lockText> <true /> </lockText> <rect> <left>12</left> <top>23</top> <right>500</right> <bottom>329</bottom> </rect> <style>scrolling</style> <autoSelect> <false /> </autoSelect> <showLines> <false /> </showLines> <wideMargins> <true /> </wideMargins> <multipleLines> <false /> </multipleLines> <reservedFamily> 0 </reservedFamily> <titleWidth>0</titleWidth> <icon>0</icon> <textAlign>left</textAlign> <font>Palatino</font> <textSize>12</textSize> <textStyle>plain</textStyle> <textHeight>16</textHeight> <name>Menu Maker Overview</name> <script>on mouseUp lock screen hide me unlock screen with visual barn door close end mouseUp</script> </part> <content> <layer>background</layer> <id>3</id> <text><span class="style34">enu Maker</span></text> </content> <content> <layer>background</layer> <id>61</id> <text>1. Click Create Menu to enter a menu name.</text> </content> <content> <layer>background</layer> <id>62</id> <text>2. Add menu items and their menu messages.</text> </content> <content> <layer>background</layer> <id>56</id> <text>Command Key:</text> </content> <content> <layer>background</layer> <id>58</id> <text>Click to edit current menu message:</text> </content> <content> <layer>background</layer> <id>59</id> <text>3. Click Create Menu Script and paste the resulting handlers into your stack script.</text> </content> <content> <layer>background</layer> <id>66</id> <text><span class="style1517">About the Menu Maker</span><span class="style1520"> </span><span class="style31"> </span><span class="style21">• Click this field to hide it. • To print this field, choose Print Field from the File menu. The Menu Maker allows you to build a menu, set the attributes for each menu item, and it updates the menu in the menu bar as you add items. When you’re finished, Menu Maker will generate the HyperTalk handlers that create the menu. You can then copy and paste these handlers into another stack. To create a menu with Menu Maker, follow these steps: 1. By clicking Create Menu in box 1: You can name your new menu and specify whether you want your new menu to replace an existing one or start on a new card. 2. Add menu items to the menu by clicking Add a Menu Item in box 2. If you’ve already added other menu items, Menu Maker asks you where to place the new item. To reorder menu items, click any item in the list to select it. Then click Delete a Menu Item or Add a Menu Item. 3. Click any menu item in the list to select it. Then set its attributes: • Click the Disable check box to dim the menu item; • Click the CheckMark check box to place a check mark before the item; • Type a character as the Command key equivalent for the item; or • Enter a HyperTalk statement that HyperCard will send as a message to the current card when the user chooses the item. 4. To generate the HyperTalk handlers, click Create Menu Script in box 3. Then copy and paste the handlers from the field to your stack. Note: To specify a menu separator (gray line), type a hyphen ("-") for the name of the menu item and click the Disable check box to select it. If your menu’s name matches the name of an existing menu, Menu Maker displays it with a “◊” prepended to the name; however, the handlers generated use the name you entered. </span></text> </content> <name>Menu Maker</name> <script>∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞ Script from background of Menu Maker in stack Power Tools THE MESSAGE HANDLERS USED IN THIS SCRIPT: openCard,closeCard,returnKey,updateTheMenu,makeNewMenu,selectMenuItem addMenuMsg,writeState,clearMenu,doMenu THE FUNCTION HANDLERS USED IN THIS SCRIPT: lineSelected ∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞ on customMenuDispose global HCTestMenuHC, LastLine, gMenuConflict if there is a menu HCTestMenuHC then delete menu HCTestMenuHC put empty into HCTestMenuHC put empty into LastLine put empty into gMenuConflict end customMenuDispose on customMenuBuild global HCTestMenuHC, LastLine put lineSelected() into LastLine put CustomMenuName() into HCTestMenuHC create menu HCTestMenuHC customMenuAddItems end customMenuBuild function CustomMenuName -- returns name of custom menu, modifying it, if nec. global gMenuConflict put bg field "MenuTitle" into menuName if menuName is empty then put "Untitled" into menuName if there is a menu menuName then repeat until (there is no menu menuName) put "◊" before menuName end repeat put true into gMenuConflict end if return menuName end CustomMenuName on customMenuAddItems global HCTestMenuHC if bg field "MenuItems" ≠ empty then put bg field "MenuItems" into menu HCTestMenuHC end if customMenuUpdateItems end customMenuAddItems on customMenuUpdateItems global HCTestMenuHC put bg field "MenuItemStuff" into menuItemInfo repeat with count = 1 to the number of lines in menuItemInfo set menuMsg of menuItem count of menu HCTestMenuHC to ¬ item 1 of line count of menuItemInfo set enabled of menuItem count of menu HCTestMenuHC to ¬ not (item 2 of line count of menuItemInfo) set checkMark of menuItem count of menu HCTestMenuHC to ¬ item 3 of line count of menuItemInfo set commandChar of menuItem count of menu HCTestMenuHC to ¬ item 4 of line count of menuItemInfo end repeat end customMenuUpdateItems -- MESSAGES FROM HYPERCARD -------------------------------------------- on openCard customMenuBuild pass openCard end openCard on closeCard customMenuDispose hideOverview pass closeCard end closeCard on suspendStack customMenuDispose hideOverview pass suspendStack end suspendStack on resumeStack customMenuBuild pass resumeStack end resumeStack on newCard ask "Please enter a name for your custom menu:" with "Untitled" if the result is not empty then -- user canceled lock screen lock messages send "doMenu" && quote & "Delete Card" & quote to HyperCard go back unlock messages unlock screen else put it into bg field "MenuTitle" -- might be empty end if end newCard on returnKey -- A 'return' is a shortcut for adding a new menu item. if the message box is not empty then pass returnKey if (the selectedField is empty) then send "mouseUp" to bg btn id 16 else pass returnKey end returnKey on doMenu whichItem,whichMenu global HCTestMenuHC if whichMenu is HCTestMenuHC then put the menuMsg of menuItem whichItem of menu HCTestMenuHC into theMsg if theMsg is empty then put "<No menu message>" into theMsg -- ∆ answer "Menu:" && whichMenu & return & "Menu message:" && theMsg -- ∆ else pass doMenu end doMenu -- UTILITIES ---------------------------------------------------------- function lineSelected put 0 into count repeat with count = 1 to number of lines in bg field "MenuItems" if (textStyle of line count of bg field "MenuItems") ≠ plain then exit repeat end repeat return count end lineSelected on selectMenuItem theLine global LastLine if ((LastLine ≠ empty) and (LastLine ≠ 0)) then set textStyle of line LastLine of bg field "MenuItems" to plain set textStyle of line theLine of bg field "MenuItems" to bold,underline,condense put line theLine of bg field "MenuItemStuff" into theState put item 1 of theState into bg field "MenuMessage" put item 4 of theState into bg field "CmdKey" if theState ≠ empty then set hilite of bg btn id 29 to item 2 of theState set hilite of bg btn id 28 to item 3 of theState end if put theLine into LastLine end if end selectMenuItem on addMenuMsg global HCTestMenuHC put lineSelected() into theMenuItem if ((theMenuItem = empty) or (theMenuItem = 0)) then answer "Please select a menu item first." -- ∆ exit addMenuMsg end if ask "Enter the menu message:" with bg field "MenuMessage" -- ∆ if the result is "Cancel" then exit addMenuMsg -- ∆ put it into bg field "MenuMessage" writeState it if there is no menu HCTestMenuHC then create menu HCTestMenuHC put bg field "MenuItems" into menu HCTestMenuHC end if customMenuUpdateItems end addMenuMsg on writeState theMenuMsg put empty into theState put lineSelected() into theMenuItem put bg field "CmdKey" into item 4 of theState put hilite of bg btn id 28 into item 3 of theState put hilite of bg btn id 29 into item 2 of theState put item 1 of line theMenuItem of bg field "MenuItemStuff" into item 1 of theState put theMenuMsg into item 1 of theState put theState into line theMenuItem of bg field "MenuItemStuff" end writeState on clearMenu global HCTestMenuHC,LastLine,gMenuConflict if there is a menu HCTestMenuHC then lock screen delete menu HCTestMenuHC put empty into bg fld "MenuTitle" put empty into bg fld "MenuItems" put empty into bg fld "MenuMessage" put empty into bg fld "Handlers" put empty into bg field "CmdKey" put empty into bg field "MenuItemStuff" put empty into bg field "MenuConflict" set hilite of bg btn id 29 to false set hilite of bg btn id 28 to false put empty into HCTestMenuHC put 0 into LastLine put empty into gMenuConflict unlock screen end if end clearMenu on hideOverview lock screen put "Menu Maker Overview" into theField hide bg field theField unlock screen end hideOverview </script> </background>